import java.util.LinkedList;
import java.util.List;

import framework.IBasicState;
import framework.IRule;


public class ReinasRule implements IRule<ReinasState>{

	public List<ReinasState> apply(ReinasState arg0) {
		return getSuccessors(arg0);
	}
	
	private List<ReinasState> getSuccessors(ReinasState state) {
		LinkedList<ReinasState> successors = new LinkedList<ReinasState>();
		ReinasState current = new ReinasState((ReinasState)state);
		for (int i = 0; i < 8; i++){
			if (current.getQueenPosition(i)<7){
				ReinasState newState = new ReinasState(current);
				newState.setQueenPositio(i, current.getQueenPosition(i)+1);
				successors.add(newState);
			}
		}
		return successors;
	}

	public boolean isApplicable(ReinasState arg0) {
		// TODO Auto-generated method stub
		return true;
	}

}
